package com.googlecode.maratische.google.gui;

import java.util.ArrayList;
import java.util.List;

import javax.swing.ListModel;
import javax.swing.event.ListDataListener;

import be.lechtitseb.google.reader.api.model.feed.FeedDescriptor;

import com.googlecode.maratische.google.model.Feed;

@Deprecated
public class FeedListModel implements ListModel {

	private List<Feed> feeds = null;
	
	public List<Feed> getFeeds() {
		if (this.feeds == null) {
			this.feeds = new ArrayList<Feed>();
		}
		return this.feeds;
	}
	
	public void add(FeedDescriptor feedDescriptor) {
//		getFeeds().add(new Feed(feedDescriptor));
	}
	
	public Feed getFeed(int index) {
		return this.feeds.get(index);
	}
	
	public void addListDataListener(ListDataListener arg0) {
		// TODO Auto-generated method stub
		
	}

	public Object getElementAt(int index) {
		return null;
//		Feed feed = getFeeds().get(index);
//		if (feed.getTitle() != null) {
//			return feed.getTitle();
//		}
//		return feed.getId()+"("+feed.getUnreadItems()+")";
	}

	public int getSize() {
		return getFeeds().size();
	}

	public void removeListDataListener(ListDataListener arg0) {
		
	}

}
